from django.db import models

# Create your models here.

class Book(models.Model):
 name = models.CharField(max_length=100,null=False)
 author = models.CharField(max_length=20,null=False)
 pub_time = models.DateTimeField(auto_now_add=True)
 price =models.FloatField(default=0)

 class Meta:
     db_table = 'book_table'
     ordering = ['-pub_time']


class Author(models.Model):
 is_active = models.BooleanField(default=True)
 username = models.CharField(max_length=100,null=False)
 data_joined = models.DateTimeField(auto_now_add=True)
 email = models.EmailField()
 visit_count = models.IntegerField(default=0)
 profile=models.TextField()
 website = models.URLField()